
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--因为dom出于性能考虑会把type，id，placeholder等数据替换掉但，value的赋值还在，这样达到复用的效果，
    不用新开辟一个空间而浪费内存，而key用来区分的，key不一样就能达到value也能替换掉-->
<div id="app">
  <span v-if="isUser">
    <label for="username">用户账号</label>
    <input type="text" id="username" placeholder="请填写账号" key="username">
  </span>
  <span v-else>
    <label for="email">用户邮箱</label>
    <input type="text" id="email" placeholder="请填写用户邮箱" key="email">
  </span>
  <button value="提交" v-on:click="isUser=!isUser">切换类型</button>
</div>
  <script src="../../project_practice/lunbotu/vue.js"></script>
  <script>
    const app = new Vue({
      el:'#app',
      data:{21
        message:"你好啊！！",
        isUser:true
      }
    })
  </script>
</body>
</html>